<template>
  <div>
    <h1 class="title">{{ act_title }}</h1>
    <div class="account">
      <img v-bind:src="icon_url" alt="" />
      <span>{{ user_name }}</span>
      <a :href="jump_url" class="backMap"></a>
      <a href="javascript:;" v-on:click="activeCenter" class="active"></a>
    </div>
        <!-- @*活动中心数据*@ -->
    <div class="model" v-show="activeFlag">
      <div class="activeMain">
        <i class="close" v-on:click="activeFlag = false">×</i>
        <h1>活动中心-{{ act_title }}</h1>
        <ul>
          <li v-for="(item, index) in activeLts" v-bind:key="index">
            <p>{{ item.str_ed_time }}结束</p>
            <em
              v-show="currid == item.active_id"
              class="current-act"
              style="color: #fd0a0a"
            ></em>
            <h5>
              【{{
                item.active_type == 1
                  ? "抽奖活动"
                  : item.active_type == 3
                  ? "通行证活动"
                  : ""
              }}】 {{ item.active_title }}
            </h5>
            <a
              v-bind:href="
                'qfyygame:///type=web_action/?action_type=2&web_url=' +
                item.url +
                '&login_mode=2'
              "
              class="ljcy"
            ></a>
          </li>
        </ul>
      </div>
    </div>
    <!-- @*活动中心数据*@ -->
  </div>
</template>
<script>
import { mapState } from "vuex";
import Cookies from "js-cookie";
import { GetAllActivity } from "../api/request";
export default {
  data() {
    return {
      activeFlag: false,
      activeLts: [],
    };
  },
  computed: {
    ...mapState("templateDate", [
      "act_title",
      "icon_url",
      "user_name",
      "jump_url",
      "map_id",
    ]),
  },
  methods: {
    async activeCenter() {
      const result = await GetAllActivity({mid:this.map_id});
      console.log(result)
      if (result.errCode == 0) {
        this.activeFlag = true;
        this.activeLts = result.data;
      }
    },
  },
};
</script>